﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<style type="text/css">
#content .page-spliter *{margin:0px;}
</style>
</head>
<body>
<jsp:include page="header.jsp" />
<script>setMenu(0);</script>
<div id="content" class="wrap">
	<div class="list bookList">
		<form method="post" name="shoping" 
		action="order.do?opt=addCar" 
		onsubmit="return chkSel();">
			<table>
				<tr class="title">
					<th class="checker"><br /><br /><br /></th>
					<th>书名</th>
					<th class="price">价格</th>
					<th class="store">库存</th>
					<th class="view">图片预览</th>
				</tr>
				<c:forEach items="${datas}" var="b" varStatus="idx">
				<tr ${idx.index%2==1?'class=odd':''}>
					<td><input type="checkbox" name="bookId" value="${b.bid}" /></td>
					<td class="title">${b.bookname}</td>
					<td>￥${b.b_price}</td>
					<td>${b.stock}</td>
					<td class="thumb"><img src="${b.image}" /></td>
				</tr>
				</c:forEach>
				
			</table>
			<div class="page-spliter">
				${nav}
			</div>
			<div class="button"><input class="input-btn" type="submit" name="submit" value="" /></div>
		</form>
		
	</div>
</div>
<div id="footer" class="wrap">
	北大青鸟网上书城 &copy; 版权所有

</div>
<script>
	function chkSel(){
		var cbxs=document.getElementsByName("bookId");
		var n=0;
		for(var i=0;i<cbxs.length;i++){
			if(cbxs[i].checked){
				n++;
			}
		}
		if(n==0){
			alert("请选择....");
			return false;
		}
		return true;
	}
</script>
</body>
</html>
